package com.xiyi.shouxin.entity.user.mapper;

import java.sql.ResultSet;
import java.sql.SQLException;

import org.springframework.jdbc.core.RowMapper;
import org.springframework.lang.Nullable;

import com.xiyi.shouxin.entity.user.Question;

public class QuestionMapper implements RowMapper<Question> {

    @Override
    @Nullable
    public Question mapRow(@Nullable ResultSet rs, int rowNum) throws SQLException {
        Question question = new Question();
        if (rs == null) {
            return question;
        }
        question.setId(rs.getLong("id"));
        question.setTitle(rs.getString("title"));
        question.setType(rs.getString("type"));
        question.setParams(rs.getString("params"));
        question.setDesc(rs.getString("desc"));
        question.setStatus(rs.getInt("status"));
        return question;
    }
}
